{% block sw_category_entry_point_card %}
<mt-card
    class="sw-category-entry-point-card"
    position-identifier="sw-category-entry-point"
    :title="$tc('sw-category.base.entry-point-card.cardTitle')"
>

    {% block sw_category_entry_point_card_selection %}
    <sw-single-select
        v-model:value="selectedEntryPoint"
        class="sw-category-entry-point-card__entry-point-selection"
        :options="entryPoints"
        :label="$tc('sw-category.base.entry-point-card.labelEntryPoint')"
        :placeholder="$tc('sw-category.base.entry-point-card.placeholderEntryPoint')"
        :help-text="helpText"
        :disabled="hasExistingNavigation || !acl.can('category.editor')"
        show-clearable-button
        @update:value="onEntryPointChange"
    />
    {% endblock %}

    {% block sw_category_entry_point_card_navigation_headline %}
    <p v-if="hasExistingNavigation">
        {{ $tc('sw-category.base.entry-point-card.existingNavigationDescription') }}
    </p>
    {% endblock %}

    {% block sw_category_entry_point_card_navigation_list %}
    <div
        v-if="hasExistingNavigation"
        class="sw-category-entry-point-card__navigation-list"
    >

        {% block sw_category_detail_entry_point_navigation_list_link %}
        <router-link
            v-for="salesChannel in initialNavigationSalesChannels"
            :key="salesChannel.id"
            :to="{ name: 'sw.sales.channel.detail.base', params: { id: salesChannel.id }}"
            class="sw-category-entry-point-card__navigation-entry"
        >
            {{ salesChannel.translated.name }}
        </router-link>
        {% endblock %}

    </div>
    {% endblock %}

    {% block sw_category_entry_point_card_sales_channel_selection %}
    <sw-category-sales-channel-multi-select
        v-if="associatedCollection"
        class="sw-category-entry-point-card__sales-channel-selection"
        :entity-collection="associatedCollection"
        :label="salesChannelSelectionLabel"
        :criteria="salesChannelCriteria"
        :placeholder="$tc('sw-category.base.entry-point-card.placeholderSalesChannels')"
        :disabled="!selectedEntryPoint || !acl.can('category.editor')"
        @update:entity-collection="onSalesChannelChange"
    />
    {% endblock %}

    {% block sw_category_entry_point_card_button_configure_home %}
    <mt-button
        class="sw-category-entry-point-card__button-configure-home"
        ghost
        size="small"
        :disabled="selectedEntryPoint !== 'navigationSalesChannels' || category.navigationSalesChannels.length === 0"
        variant="secondary"
        @click="openConfigureHomeModal"
    >
        {{ $tc('sw-category.base.entry-point-card.buttonConfigureHome') }}
    </mt-button>
    {% endblock %}

    {% block sw_category_entry_point_card_configure_home_modal %}
    <sw-category-entry-point-modal
        v-if="configureHomeModalVisible"
        :sales-channel-collection="category.navigationSalesChannels"
        @modal-close="closeConfigureHomeModal"
    />
    {% endblock %}
</mt-card>
{% endblock %}
